﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmListQ.aspx.cs" Inherits="EXAM.Windows.frmListQ" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Question List</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
//<![CDATA[
    function GetRadWindow()
    {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
        return oWindow;
    }
    
    
    function returnToParent(temp1)
    {
       // var grid = $find("<%= dgvList.ClientID %>");
      //  var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
     //   grid.get_masterTableView().selectItem(rowControl, true);
         
         var info = new Object();
             info.DlgRes =temp1;             
         
         var oWnd =GetRadWindow();
          if(info)
            {
          
                oWnd.close(info);
            }                  
    }   
 
 
//]]>
        </script>

    </telerik:RadCodeBlock>
    <div>
        <telerik:RadGrid ID="dgvList" runat="server" AutoGenerateColumns="False" GridLines="None"
            Skin="Sunset" AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True"
            ShowGroupPanel="True" OnNeedDataSource="dgvList_NeedDataSource" DataMember="dtQuest"
            OnItemCreated="dgvList_ItemCreated">
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007">
            </HeaderContextMenu>
            <GroupPanel Text="Drag a column header here to group by">
            </GroupPanel>
            <MasterTableView PageSize="20" DataKeyNames="Line" DataMember="dtQuest" EditMode="InPlace">
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="Select" UniqueName="TemplateColumn" HeaderStyle-Width="30px">
                        <ItemTemplate>
                            <asp:HyperLink ID="CloseLink" runat="server">Select</asp:HyperLink>
                        </ItemTemplate>
                        <HeaderStyle Width="30px"></HeaderStyle>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="No" FilterControlAltText="Filter column column"
                        HeaderText="No" UniqueName="column110" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Line" FilterControlAltText="Filter column1 column"
                        HeaderText="Line" ReadOnly="True" UniqueName="column111">
                        <HeaderStyle Width="15px" />
                        <ItemStyle Width="15px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Test_ID" FilterControlAltText="Filter column2 column"
                        HeaderText="TestID" UniqueName="column112" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Question_ID" FilterControlAltText="Filter column column"
                        HeaderText="QuestID" UniqueName="column2" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="QuestName" FilterControlAltText="Filter column1 column"
                        HeaderText="Question" ReadOnly="True" UniqueName="column1">
                    </telerik:GridBoundColumn>
                    <telerik:GridNumericColumn DataField="Score" DecimalDigits="2" FilterControlAltText="Filter column4 column"
                        HeaderText="Score" ReadOnly="True" UniqueName="column114" Visible="False">
                    </telerik:GridNumericColumn>
                    <telerik:GridDateTimeColumn DataField="Creation_Time_" DataFormatString="{0:dd/MM/yyyy}"
                        FilterControlAltText="Filter column5 column" HeaderText="Creation" UniqueName="column115"
                        Visible="False">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridNumericColumn DataField="Display_Time" DecimalDigits="2" FilterControlAltText="Filter column6 column"
                        HeaderText="Display(min)" UniqueName="column116" Visible="False">
                    </telerik:GridNumericColumn>
                    <telerik:GridNumericColumn DataField="Change_Time" DecimalDigits="2" FilterControlAltText="Filter column7 column"
                        HeaderText="Change(min)" UniqueName="column117" Visible="False">
                    </telerik:GridNumericColumn>
                    <telerik:GridBoundColumn DataField="Type" FilterControlAltText="Filter column8 column"
                        HeaderText="Type" ReadOnly="True" UniqueName="column118" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="IsAnswer" FilterControlAltText="Filter column column"
                        HeaderText="Is Answer" UniqueName="column">
                        <ItemTemplate>
                            <asp:CheckBox ID="IsAnswerLabel" runat="server" Checked='<%# Eval("IsAnswer").ToString()=="1" %>'
                                Enabled="false"></asp:CheckBox>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn ButtonType="ImageButton" />
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column" UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True">
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
